﻿using System;
using System.Collections.Generic;
using System.Text;

namespace csharpcore7_ch3.Chapt3_3ObjectClass
{
    class Chapt3_3_2StaticAndRuntimeTypeChecking
    {
        static void _Main()
        {
            //int x = "5"; //静态类型检查

            //在堆上的每一个对象都在内部存储了类型标识
            object y = "5";
            Console.WriteLine(y.GetType()); //System.String。使用object类的GetType方法得到类型标识
            //int z = (int)y;     //运行时错误，向下转型失败
        }
    }
}
